
#include "../common/detail.hpp"
#include "../client/rpc_client.hpp"
#include <iostream>


int main()
{
    //实例化订阅客户端
    auto client = std::make_shared<rpc::client::TopicClient>("127.0.0.1", 8080);
    //创建主题
    bool ret = client->create("hello");
    if(!ret)
    {
        //ELOG("主题创建失败");
        std::cerr<<"主题创建失败";
    }
    //向主题发布消息
    for(int i = 1; i <= 10; i++)
    {
        ret = client->publish("hello", "Hello World-"+std::to_string(i));
    }
    //退出
    client->shutdown();
    return 0;
}